<style scoped>
  .time{
    font-size: 14px;
    font-weight: bold;
  }
  .content{
    padding-left: 5px;
  }
  .hisLine{
    margin: 0 20%;
  }
</style>
<template>
  <Timeline class="hisLine  layout-content-body">
    <Timeline-item v-for="item in watchHistory" :key="item.Id">
      <p class="time">{{item.Ctime.slice(0,10)}}</p>
      <p class="content">{{item.VideoName}}&nbsp&nbsp观看时长:{{item.LookLong}}秒</p>
    </Timeline-item>
  </Timeline>
</template>
<script>
  import api from '../../api'
  export default {
    data: function () {
      return {
        watchHistory: [],

      }
    },
    methods:{
      getall (){
        this.spinShow = true
        api.GetWatchHistory().then(response => {
          if (response.data.code === 0) {
            this.watchHistory = response.data.Data
          } else {
            this.$Notice.warning({
              title: '数据异常',
              desc: this.msg
            });
          }
        }, error => {
          this.$Notice.warning({
            title: '数据异常',
            desc: this.msg
          });
        })
      },
    },
    mounted (){
      this.getall()
    }
  }
</script>
